#include "rcs.hh"
#include "rcs_print.hh"

// Include command and status message definitions
#include "nml_intf/canon.hh"
#include "nml_intf/canon_position.hh"
#include "nml_intf/zuc.hh"
#include "nml_intf/zuc_nml.hh"
#include "nml_intf/zucglb.h"
#include "zuc/nml_intf/zucpos.h"
#include "cms.hh"
#include "config.h"
#include "zuc/nml_intf/zuc_nml_io_commu.hh"
#include "zuc/nml_intf/zuc_nml_rob_cmd.hh"
#include "zuc/nml_intf/zucpos2.h"

// Forward Function Prototypes
void ZucPose_update(CMS* cms, ZucPose* x);
void initialize_PmCartesian(PmCartesian* x);
void CANON_VECTOR_update(CMS* cms, CANON_VECTOR* x);
void initialize_CANON_TOOL_TABLE(CANON_TOOL_TABLE* x);
void initialize_ZucPose(ZucPose* x);
void CANON_POSITION_update(CMS* cms, CANON_POSITION* x);
void initialize_CANON_POSITION(CANON_POSITION* x);
void SafetyFuncDIMap_Update(CMS* cms, SafetyFuncDIMap* x);
void SafetyFuncDOMap_Update(CMS* cms, SafetyFuncDOMap* x);
void CurFeedForward_update(CMS* cms, double* grvCurrent);
void ExtIOSetup_update(CMS* cms, ExtIOSetup* x);
void ExtIOConfig_update(CMS* cms, ExtIOModConfig* x);
void TIOStatusUpdate(CMS* cms, TIOStatus* x);
void GripperStateUnitUpdate(CMS* cms, GripperStateUnit* x);
void SensorConfig_update(CMS* cms, SensorConfig* x);
void SensorStatus_update(CMS* cms, SensorStatus* x);
void JointMonitorData_update(CMS* cms, JointMonitorData* x);
void Payload_update(CMS* cms, Payload* x);
void Dynamics_update(CMS* cms, Dynamics* x);
void FtConfig_update(CMS* cms, FtConfig* ftConfig);
void EndForceCond_update(CMS* cms, EndForceCond* endForceCond);
void IOTrigger_update(CMS* cms, IOTrigger* x);
void CaptureStatus_update(CMS* cms, CaptureStatus* x);
void TIORSChnConfig_update(CMS* cms, TIORSChnConfig* x);
void TIOPinConfig_update(CMS* cms, TIOPinConfig* x);
void TIOConfig_update(CMS* cms, TIOConfig* x);
void JointLimit_update(CMS* cms, JointPosLimit* x);

/*
*	NML/CMS Format function : zucFormat
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
#define ZUC_CMD_FORMAT(_NAME)          \
    case _NAME##_TYPE: {               \
        ((_NAME*)buffer)->update(cms); \
        break;                         \
    }

int zucFormat(NMLTYPE type, void* buffer, CMS* cms)
{
    switch (type)
    {
        ZUC_CMD_FORMAT(ZUC_JOG_CONT)
        ZUC_CMD_FORMAT(ZUC_JOG_INCR)
        ZUC_CMD_FORMAT(ZUC_JOG_ABS)
        ZUC_CMD_FORMAT(ZUC_JOG_MULTI_JOINT)
        ZUC_CMD_FORMAT(ZUC_JOG_MOVJ)
        ZUC_CMD_FORMAT(ZUC_JOG_MOVL)
        ZUC_CMD_FORMAT(ZUC_JOG_MOVC)
        ZUC_CMD_FORMAT(ZUC_JOG_STOP)
        ZUC_CMD_FORMAT(ZUC_SET_ROBOT_NAME)
        ZUC_CMD_FORMAT(ZUC_SET_CABINET_ID)
        ZUC_CMD_FORMAT(ZUC_SET_CUSTOM_POSE)
        ZUC_CMD_FORMAT(ZUC_SET_SERVOJ_PARAMETER)
        ZUC_CMD_FORMAT(ZUC_TASK_SET_PAYLOAD_IDENTIFY_TRAJ_STARTPOS)
        ZUC_CMD_FORMAT(ZUC_TASK_SET_PAYLOAD_IDENTIFY_TRAJ_ENDPOS)
        ZUC_CMD_FORMAT(ZUC_TASK_START_PAYLOAD_IDENTIFY_TRAJ)
        ZUC_CMD_FORMAT(ZUC_TASK_RESET_PAYLOAD_IDENTIFY_STATUS)
        ZUC_CMD_FORMAT(ZUC_GET_PAYLOAD_IDENTIFY_RESULT)
        ZUC_CMD_FORMAT(ZUC_STOP_IDENTIFY_FRICTION)
        ZUC_CMD_FORMAT(ZUC_START_IDENTIFY_FRICTION)
        ZUC_CMD_FORMAT(ZUC_IDENTIFY_FRICTION_END_POS)
        ZUC_CMD_FORMAT(ZUC_IDENTIFY_FRICTION_START_POS)
        ZUC_CMD_FORMAT(ZUC_SERVO_DYNAMICS_PARA)
        ZUC_CMD_FORMAT(ZUC_SERVO_FRICTION)
        ZUC_CMD_FORMAT(ZUC_COLLISION_SENSITIVITY)
        ZUC_CMD_FORMAT(ZUC_BACKDRIVE_ON)
        ZUC_CMD_FORMAT(ZUC_FORCE_LIMIT_VALUE)
        ZUC_CMD_FORMAT(ZUC_COLLISION_DETECTION_ENABLE)
        ZUC_CMD_FORMAT(ZUC_RS485_MESSAGE)
        ZUC_CMD_FORMAT(ZUC_TIO_RS485_SIG_PROG_STAT)
        ZUC_CMD_FORMAT(ZUC_TORQUE_CONTROL_ENABLE)
        ZUC_CMD_FORMAT(ZUC_GRAVITY_DIRECTION)
        ZUC_CMD_FORMAT(ZUC_DRAG_CONTROL_ENABLE)
        ZUC_CMD_FORMAT(ZUC_DRAG_CONTROL_FC_COMPENSATE)
        ZUC_CMD_FORMAT(ZUC_DRAG_CONTROL_FV_COMPENSATE)
        ZUC_CMD_FORMAT(ZUC_DRAG_CONTROL_FILTER_FACTOR)
        ZUC_CMD_FORMAT(ZUC_DRAG_CONTROL_DITHER_FACTOR)
        ZUC_CMD_FORMAT(ZUC_TASK_START_DYNAMICS_IDENTIFY)
        ZUC_CMD_FORMAT(ZUC_TASK_STOP_DYNAMICS_IDENTIFY)
        ZUC_CMD_FORMAT(ZUC_JOINT_SET_MAX_POSITION_LIMIT)
        ZUC_CMD_FORMAT(ZUC_JOINT_SET_MIN_POSITION_LIMIT)
        ZUC_CMD_FORMAT(ZUC_HALT)
        ZUC_CMD_FORMAT(ZUC_INIT)
        ZUC_CMD_FORMAT(ZUC_MOTION_ABORT)
        ZUC_CMD_FORMAT(ZUC_MOTION_HALT)
        ZUC_CMD_FORMAT(ZUC_MOTION_INIT)
        ZUC_CMD_FORMAT(ZUC_MOTION_SET_AOUT)
        ZUC_CMD_FORMAT(ZUC_MOTION_SET_DOUT)
        ZUC_CMD_FORMAT(ZUC_MOTION_PERCENTAGE_MODE_LEVEL_VALUE)
        ZUC_CMD_FORMAT(ZUC_MOTION_SET_FREE_BUTTON_OPT)
        ZUC_CMD_FORMAT(ZUC_MOTION_SET_POINT_BUTTON_OPT)
        ZUC_CMD_FORMAT(ZUC_MOTION_SET_FREE_PROG_BUTTON_OPT)
        ZUC_CMD_FORMAT(ZUC_MOTION_ADAPTIVE)
        ZUC_CMD_FORMAT(ZUC_MOTION_EXIT_PROTECT)
        ZUC_CMD_FORMAT(ZUC_MOTION_PERCENTAGE_MODE)
        ZUC_CMD_FORMAT(ZUC_MOTION_REDUCE_MODE)
        ZUC_CMD_FORMAT(ZUC_MOTION_KINE_INVERSE)
        ZUC_CMD_FORMAT(ZUC_MOTION_KINE_FORWARD)
        ZUC_CMD_FORMAT(ZUC_MOTION_SET_FUNCDI)
        ZUC_CMD_FORMAT(ZUC_MOTION_SET_FUNCDO)
        ZUC_CMD_FORMAT(ZUC_MOTION_SET_SAFETY_FUNCDI)
        ZUC_CMD_FORMAT(ZUC_MOTION_SET_SAFETY_FUNCDO)
        ZUC_CMD_FORMAT(ZUC_MOTION_STAT)
        ZUC_CMD_FORMAT(ZUC_MOTION_SET_HOME_VEL)
        ZUC_CMD_FORMAT(ZUC_NULL)
        ZUC_CMD_FORMAT(ZUC_OPERATOR_DISPLAY)
        ZUC_CMD_FORMAT(ZUC_OPERATOR_ERROR)
        ZUC_CMD_FORMAT(ZUC_OPERATOR_TEXT)
        ZUC_CMD_FORMAT(ZUC_SYSTEM_CMD)
        ZUC_CMD_FORMAT(ZUC_SET_DEBUG)
        ZUC_CMD_FORMAT(ZUC_SETUP_MODBUS_SLAVE)
        ZUC_CMD_FORMAT(ZUC_EXTIO_SETUP)
        ZUC_CMD_FORMAT(ZUC_EXTIO_SETMODE)
        ZUC_CMD_FORMAT(ZUC_SET_MAINTENANCE_MODE)
        ZUC_CMD_FORMAT(ZUC_TORQSENSOR_SETCOMM)
        ZUC_CMD_FORMAT(ZUC_TORQSENSOR_SETPAYLOAD)
        ZUC_CMD_FORMAT(ZUC_TOOL_SETPAYLOAD)
        ZUC_CMD_FORMAT(ZUC_TORQSENSOR_SETMODE)
        ZUC_CMD_FORMAT(ZUC_TORQSENSOR_SETBRAND)
        ZUC_CMD_FORMAT(ZUC_TORQUE_SENSOR_SOFT_LIMIT)
        ZUC_CMD_FORMAT(ZUC_ADMITTANCE_DRAG_DEAD_ZONE)
        ZUC_CMD_FORMAT(ZUC_IDENTIFY_CYCLE_TIME)
        ZUC_CMD_FORMAT(ZUC_TORQUE_SENSOR_FILTER)
        ZUC_CMD_FORMAT(ZUC_FUNCTION_SAFTY_PARA)
        ZUC_CMD_FORMAT(ZUC_COLLISION_GM_RECORD_ENABLE)
        ZUC_CMD_FORMAT(ZUC_STAT)
        ZUC_CMD_FORMAT(ZUC_TASK_ABORT)
        ZUC_CMD_FORMAT(ZUC_TASK_HALT)
        ZUC_CMD_FORMAT(ZUC_TASK_INIT)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_CLOSE)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_END)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_EXECUTE)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_INIT)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_OPEN)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_PAUSE)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_READ)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_RESUME)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_RUN)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_STEP)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_SYNCH)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_SET_OPTIONAL_STOP)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_SET_BLOCK_DELETE)
        ZUC_CMD_FORMAT(ZUC_TASK_PLAN_OPTIONAL_STOP)
        ZUC_CMD_FORMAT(ZUC_TASK_CALC_TCP)
        ZUC_CMD_FORMAT(ZUC_TASK_CALC_SAFEATT)
        ZUC_CMD_FORMAT(ZUC_TASK_CALC_USER)
        ZUC_CMD_FORMAT(ZUC_TASK_SET_MODE)
        ZUC_CMD_FORMAT(ZUC_TASK_SET_OPERATION_MODE)
        ZUC_CMD_FORMAT(ZUC_TASK_SET_STATE)
        ZUC_CMD_FORMAT(ZUC_TASK_SET_AUTOWORK)
        ZUC_CMD_FORMAT(ZUC_TASK_SET_SCRIPT_BACKUP)
        ZUC_CMD_FORMAT(ZUC_TASK_STAT)
        ZUC_CMD_FORMAT(ZUC_TRAJ_DELAY)
        ZUC_CMD_FORMAT(ZUC_TRAJ_LINEAR_MOVE)
        ZUC_CMD_FORMAT(ZUC_TRAJ_CIRCULAR_MOVE)
        ZUC_CMD_FORMAT(ZUC_TRAJ_JOINT_MOVE)
        ZUC_CMD_FORMAT(ZUC_TRAJ_MOVS)
        ZUC_CMD_FORMAT(ZUC_TRAJ_RIGID_TAP)
        ZUC_CMD_FORMAT(ZUC_AUX_INPUT_WAIT)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_HOME)
        ZUC_CMD_FORMAT(ZUC_RETURN_TO_INITIAL_POSITION)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_MAX_VELOCITY)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_ROBOT_TOOL_OFFSET)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_ROBOT_USER_FRAME)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_PAYLOAD)
        ZUC_CMD_FORMAT(ZUC_TRAJ_CALIB_DHPARAM)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_SCALE)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_RAPID_SCALE)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_TELEOP_ENABLE)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_TELEOP_TOOL_ENABLE)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_SERVOJOP_ENABLE)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_ADMITOP_ENABLE)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_COMPLIANCE_ENABLE)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_ADMITTANCE_FRAME)
        ZUC_CMD_FORMAT(ZUC_TRAJ_DISABLE_FORCE_CONTROL)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_ADMITTANCE_ENABLE)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_ADMITTANCE_OPTION)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_ADMITTANCE_CONFIG)
        ZUC_CMD_FORMAT(ZUC_SET_SAFE_ZONE)
        ZUC_CMD_FORMAT(ZUC_SET_SAFE_ATTITUDE)
        ZUC_CMD_FORMAT(ZUC_SET_PLANNER_JERK)
        ZUC_CMD_FORMAT(ZUC_ROBOT_SAFETY)
        ZUC_CMD_FORMAT(ZUC_SET_ROBOT_SAFETY_CUSTOMIZE)
        ZUC_CMD_FORMAT(Robot_7_DOF_INV_INFORM)
        ZUC_CMD_FORMAT(Robot_SET_FULL_DH_FLAG)
        ZUC_CMD_FORMAT(Robot_SET_7_DOF_KINE_PARAM_ALPHA_K)
        ZUC_CMD_FORMAT(ZUC_REDUCE_SAFETY)
        ZUC_CMD_FORMAT(ZUC_DRAG_SPEED_LIMIT)
        ZUC_CMD_FORMAT(ZUC_JOINT_SAFETY)
        ZUC_CMD_FORMAT(ZUC_TRAJ_SET_END_FORCE_CONDITION)
        ZUC_CMD_FORMAT(ZUC_SET_CHECK_CAN_CONNECTION)
        ZUC_CMD_FORMAT(ZUC_SET_SERVO_PARAM)
        ZUC_CMD_FORMAT(ZUC_SERVO_UPGRADE)
        ZUC_CMD_FORMAT(ZUC_SET_MUTI_TOOL_OFFSET)
        ZUC_CMD_FORMAT(ZUC_SET_TOOL_ID)
        ZUC_CMD_FORMAT(ZUC_SET_MUTI_USER_OFFSET)
        ZUC_CMD_FORMAT(ZUC_SET_USER_ID)
        ZUC_CMD_FORMAT(ZUC_CONVEYOR_ENABLE)
        ZUC_CMD_FORMAT(ZUC_CONVEYOR_DISABLE)
        ZUC_CMD_FORMAT(ZUC_TOPPRA_FINISH_LEFT_TC)
        ZUC_CMD_FORMAT(ZUC_TOPPRA_FIRST_COMMAND)
        ZUC_CMD_FORMAT(ZUC_TRAJ_MOVC)
        ZUC_CMD_FORMAT(ZUC_SHUT_DOWN)
        ZUC_CMD_FORMAT(ZUC_MOTION_SETUP_IO_CHANNEL)
        ZUC_CMD_FORMAT(ZUC_MOTION_SET_BR_STRT_VOLTAGE)
        ZUC_CMD_FORMAT(ZUC_SET_NET_EXCEPTION_HANDLE)
        ZUC_CMD_FORMAT(ZUC_MBTIO_ADD_SIGNAL)
        ZUC_CMD_FORMAT(ZUC_MBTIO_DEL_SIGNAL)
        ZUC_CMD_FORMAT(ZUC_MBTIO_UPDATE_SIGNAL)
        ZUC_CMD_FORMAT(ZUC_MBTIO_SEND_COMMAND)
        ZUC_CMD_FORMAT(ZUC_STEP_STATUS)
        ZUC_CMD_FORMAT(ZUC_SET_COLLISION_OPTION)
        ZUC_CMD_FORMAT(ZUC_SET_GRPC_ERRCODE)
        ZUC_CMD_FORMAT(ZUC_SET_CABVOLTAGE)
        ZUC_CMD_FORMAT(ZUC_SET_DRAG_ENABLE)
        ZUC_CMD_FORMAT(ZUC_SET_ROBOT_PAYLOAD)
        ZUC_CMD_FORMAT(ZUC_SERVO_HOME)
        ZUC_CMD_FORMAT(ZUC_CLEAR_ERROR)
        ZUC_CMD_FORMAT(ZUC_SET_BASE_OFFSET)
    default:
        return (0);
    }
    return 1;
}

/*
*	NML/CMS Update function for ZUC_TASK_PLAN_CLOSE
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_TASK_PLAN_CLOSE::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_CMD_MSG
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_CMD_MSG::update(CMS* cms) {}

/*
*	NML/CMS Update function for ZUC_OPERATOR_DISPLAY
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_OPERATOR_DISPLAY::update(CMS* cms)
{
    cms->update(id);
    cms->update(display, 256);
}

/*
*	NML/CMS Update function for ZUC_SYSTEM_CMD
*	Manually stuck in here by FMP
*	on 27-Apr-2005 at the ZUC Codefest
*/
void ZUC_SYSTEM_CMD::update(CMS* cms) { cms->update(string, 256); }

void ZUC_SERVO_UPGRADE::update(CMS* cms) { ZUC_MOTION_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_MOTION_INIT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_MOTION_INIT::update(CMS* cms) { ZUC_MOTION_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_TRAJ_DELAY
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_TRAJ_DELAY::update(CMS* cms)
{
    cms->update(line_num);
    cms->update(delay);
}

void Robot_SET_FULL_DH_FLAG::update(CMS* cms) { cms->update(full_dh_flag); }

void ZUC_SET_ROBOT_NAME::update(CMS* cms) { cms->update(name, LINELEN); }

void ZUC_SET_CABINET_ID::update(CMS* cms) { cms->update(cabinet_id); }

void ZUC_TASK_SET_PAYLOAD_IDENTIFY_TRAJ_STARTPOS::update(CMS* cms)
{
    cms->update(trajId);
    cms->update(jointTraj.startJntPos, ZUCMOT_MAX_JOINTS);
}

void ZUC_TASK_SET_PAYLOAD_IDENTIFY_TRAJ_ENDPOS::update(CMS* cms)
{
    cms->update(trajId);
    cms->update(jointTraj.endJntPos, ZUCMOT_MAX_JOINTS);
}

void ZUC_TASK_START_PAYLOAD_IDENTIFY_TRAJ::update(CMS* cms)
{
    cms->update(trajId);
    cms->update(withPayload);
}

void ZUC_TASK_RESET_PAYLOAD_IDENTIFY_STATUS::update(CMS* cms) { cms->update(userOpt); }

void ZUC_GET_PAYLOAD_IDENTIFY_RESULT::update(CMS* cms) { cms->update(heartBeat); }

void ZUC_STOP_IDENTIFY_FRICTION::update(CMS* cms) { cms->update(friction_identify_joint_index); }

void ZUC_START_IDENTIFY_FRICTION::update(CMS* cms) { cms->update(friction_identify_joint_index); }

void ZUC_IDENTIFY_FRICTION_END_POS::update(CMS* cms)
{
    cms->update(friction_identify_joint_index);
    cms->update(friction_identify_end_pos, ZUCMOT_MAX_JOINTS);
}

void ZUC_IDENTIFY_FRICTION_START_POS::update(CMS* cms)
{
    cms->update(friction_identify_joint_index);
    cms->update(friction_identify_start_pos, ZUCMOT_MAX_JOINTS);
}

void ZUC_RS485_MESSAGE::update(CMS* cms)
{
    cms->update(chn);
    cms->update(len);
}

void ZUC_TIO_RS485_SIG_PROG_STAT::update(CMS* cms)
{
    cms->update(sig_name, 128);
    cms->update(prog_stat);
}
void ZUC_DRAG_CONTROL_ENABLE::update(CMS* cms) { cms->update(drag_control_enable); }

void ZUC_DRAG_CONTROL_FC_COMPENSATE::update(CMS* cms) { cms->update(drag_control_fc_compensate, ZUCMOT_MAX_JOINTS); }

void ZUC_DRAG_CONTROL_FV_COMPENSATE::update(CMS* cms) { cms->update(drag_control_fv_compensate, ZUCMOT_MAX_JOINTS); }

void ZUC_DRAG_CONTROL_FILTER_FACTOR::update(CMS* cms) { cms->update(drag_control_filter_factor, ZUCMOT_MAX_JOINTS); }

void ZUC_DRAG_CONTROL_DITHER_FACTOR::update(CMS* cms) { cms->update(drag_control_dither_factor, ZUCMOT_MAX_JOINTS); }

void ZUC_TORQUE_CONTROL_ENABLE::update(CMS* cms)
{
    cms->update(torque_control_enable);
    cms->update(torque_last_period);
}

void ZUC_GRAVITY_DIRECTION::update(CMS* cms) { cms->update(rpy, 3); }

void ZUC_TASK_START_DYNAMICS_IDENTIFY::update(CMS* cms) { cms->update(heartBeat); }

void ZUC_TASK_STOP_DYNAMICS_IDENTIFY::update(CMS* cms) { cms->update(heartBeat); }

void ZUC_IDENTIFY_CYCLE_TIME::update(CMS* cms) { cms->update(identify_cycle_time); }

/*
*	NML/CMS Update function for ZUC_TASK_PLAN_SYNCH
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_TASK_PLAN_SYNCH::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_JOINT_SET_MIN_POSITION_LIMIT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_JOINT_SET_MIN_POSITION_LIMIT::update(CMS* cms)
{
    ZUC_JOINT_CMD_MSG::update(cms);
    cms->update(limit);
}

/*
*	NML/CMS Update function for ZUC_TASK_ABORT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_TASK_ABORT::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_MOTION_HALT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_MOTION_HALT::update(CMS* cms) { ZUC_MOTION_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_TASK_PLAN_INIT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_TASK_PLAN_INIT::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_JOINT_CMD_MSG
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_JOINT_CMD_MSG::update(CMS* cms)
{
    cms->update(robot_id);
    cms->update(joint);
}

void ZUC_SETUP_MODBUS_SLAVE::update(CMS* cms)
{
    cms->update(commType);
    cms->update((unsigned char*)(&mbComm), sizeof(CommInfo));
}

void ZUC_EXTIO_SETUP::update(CMS* cms)
{
    cms->update(extIOModCnt);
    for (int i = 0; i < MAX_EXTIO_CNT; i++) { ExtIOSetup_update(cms, &extIOSetup[i]); }
}

void ZUC_EXTIO_SETMODE::update(CMS* cms) { cms->update(mode); }

void ZUC_SET_MAINTENANCE_MODE::update(CMS* cms) { cms->update(maintenance); }

void ZUC_TORQSENSOR_SETCOMM::update(CMS* cms)
{
    cms->update(commType);
    cms->update((unsigned char*)(&commCfg), sizeof(CommInfo));
}

void ZUC_TORQSENSOR_SETPAYLOAD::update(CMS* cms) { Payload_update(cms, &payload); }

void ZUC_TOOL_SETPAYLOAD::update(CMS* cms) { Payload_update(cms, &payload); }

void ZUC_FUNCTION_SAFTY_PARA::update(CMS* cms)
{
    cms->update(robot_power_limit, 2);
    cms->update(robot_momentum_limit, 2);
    cms->update(robot_endforce_limit, 2);
    cms->update(robot_velocity_limit);
}

void ZUC_COLLISION_GM_RECORD_ENABLE::update(CMS* cms) { cms->update(gm_record_enable); }

void ZUC_COLLECT_DIAG_DATA::update(CMS* cms) { cms->update(isStart); }

/*
*	NML/CMS Update function for ZUC_STAT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_STAT::update(CMS* cms)
{
    ZUC_STAT_MSG::update(cms);
    cms->update(autoopsetting.onekeyenable);
    cms->update(autoopsetting.autoprogram);
    task.update(cms);
    motion.update(cms);
    ext_motion[0].update(cms);
    ext_motion[1].update(cms);
    monitor.update(cms);
    cms->update(robotName, LINELEN);
    cms->update(debug);
    cms->update(operation_mode);
    cms->update(operation_mode_option);
    cms->update(mbSlaveCommType);
    cms->update((unsigned char*)(&mbSlaveCommInfo), sizeof(CommInfo));
    cms->update(debug);
    cms->update(isSteppingMode);
    cms->update(steppingState);
    cms->update(steppingWait);
    cms->update(cab_type);
    cms->update(func_licence);
    // cms->update(auto_op_setting);
    cms->update(robotSafety, 19);
    for (int i = 0; i < 12; ++i) jointLimit[i].update(cms);
    for (int i = 0; i < 6; ++i) robotSafe[i].update(cms);
    stepStatus.update(cms);
    netExceptionHandle.update(cms);
    for (int i = 0; i < MAX_SUB_THREAD; ++i) cms->update(&sub_thread_state[i][0], LINELEN);

    cms->update(grpc_errtype);
    cms->update(grpc_errcode);
    cms->update(repeatflag);
    cms->update(grpc_errmsg, LINELEN);
    cms->update(appConnectionStatus);
    cms->update(currSimMode);
    cms->update(currSimRobot);
    cms->update(initSimMode);
    cms->update(isDiagCollecting);
    reduceSafe.update(cms);
}

/*
*	NML/CMS Update function for CANON_VECTOR
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void CANON_VECTOR_update(CMS* cms, CANON_VECTOR* x)
{
    cms->update(x->x);
    cms->update(x->y);
    cms->update(x->z);
}

/*
*	NML/CMS Update function for ZUC_MOTION_SET_AOUT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_MOTION_SET_AOUT::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(index);
    cms->update(start);
    cms->update(end);
    cms->update(now);
}

/*
*	NML/CMS Update function for ZUC_JOINT_SET_MAX_POSITION_LIMIT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_JOINT_SET_MAX_POSITION_LIMIT::update(CMS* cms)
{
    ZUC_JOINT_CMD_MSG::update(cms);
    cms->update(limit);
}

void ZUC_TASK_PLAN_RUN::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(line);
}

/*
*	NML/CMS Update function for ZUC_TASK_PLAN_RESUME
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_TASK_PLAN_RESUME::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_TASK_CMD_MSG
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_TASK_CMD_MSG::update(CMS* cms) {}

/*
*	NML/CMS Update function for ZUC_OPERATOR_TEXT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_OPERATOR_TEXT::update(CMS* cms)
{
    cms->update(id);
    cms->update(text, 256);
}

/*
*	NML/CMS Update function for ZUC_TASK_PLAN_READ
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_TASK_PLAN_READ::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for CANON_TOOL_TABLE
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/

/*
*	NML/CMS Update function for ZUC_ABORT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_ABORT::update(CMS* cms) { ZUC_CMD_MSG::update(cms); }

void ZUC_SET_CHECK_CAN_CONNECTION::update(CMS* cms)
{
    ZUC_CMD_MSG::update(cms);
    cms->update(check);
}

/*
*	NML/CMS Update function for ZUC_JOINT_STAT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
/*
*	NML/CMS Update function for ZUC_INIT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_INIT::update(CMS* cms) { ZUC_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_TASK_STAT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_TASK_STAT_MSG::update(CMS* cms) { cms->update(heartbeat); }
void ZUC_TASK_STAT::update(CMS* cms)
{
    ZUC_TASK_STAT_MSG::update(cms);
    cms->update((int*)&mode, 1);
    cms->update((int*)&state, 1);
    cms->update((int*)&execState, 1);
    cms->update((int*)&interpState, 1);
    cms->update(callLevel);
    cms->update(motionLine);
    cms->update(currentLine);
    cms->update(readLine);
    cms->update(sleepLine);
    cms->update(executingLine);
    cms->update(optional_stop_state);
    cms->update(block_delete_state);
    cms->update(input_timeout);
    cms->update(file, sizeof(file));
    cms->update(file_auto_mode, sizeof(file_auto_mode));
    cms->update(file_manu_mode, sizeof(file_manu_mode));
    cms->update(command, sizeof(command));
    ZucPose_update(cms, &robotToolOffset);
    ZucPose_update(cms, &robotUserOffset);
    cms->update(programUnits);
    cms->update(interpreter_errcode);
    cms->update(task_paused);
    cms->update(delayLeft);
    cms->update(queuedMDIcommands);
    cms->update(base_offset.y);
    cms->update(base_offset.p);
    cms->update(base_offset.r);
    cms->update(autoWork.enable);
    cms->update(autoWork.filename, sizeof(autoWork.filename));
    cms->update(backupSetting.enable);
    cms->update(backupSetting.interval);
    cms->update(clsnDetectMethod);
    cms->update(clsnReactTypeWhenProgRun);
    cms->update(clsnReactReboundAngle);

    for (int i = 0; i < 4; i++)
    {
        cms->update(payloadIdentifyTraj[i].startJntPos, ZUCMOT_MAX_JOINTS);
        cms->update(payloadIdentifyTraj[i].endJntPos, ZUCMOT_MAX_JOINTS);
    }
    cms->update(errAddLine);
    for (size_t i = 0; i < sizeof(callStack) / sizeof(struct CallStack); i++)
    {
        cms->update(callStack[i].executingLine);
        cms->update(callStack[i].file, sizeof(callStack[i].file));
    }
}

/*
*	NML/CMS Update function for ZUC_TASK_SET_STATE
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_TASK_SET_STATE::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update((int*)&state, 1);
    cms->update(robid);
}

void ZUC_TASK_SET_AUTOWORK::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(enable);
    cms->update(filename, sizeof(filename));
}

void ZUC_TASK_SET_SCRIPT_BACKUP::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(enable);
    cms->update(interval);
}

/*
*	NML/CMS Update function for ZUC_STAT_MSG
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_STAT_MSG::update(CMS* cms) {}

/*
*	NML/CMS Update function for ZUC_TASK_SET_MODE
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:16 UTC 2003
*/
void ZUC_TASK_SET_MODE::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update((int*)&mode, 1);
}

void ZUC_TASK_SET_OPERATION_MODE::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update((int*)&opmode, 1);
}

void ZUC_TASK_PLAN_END::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_OPERATOR_ERROR
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/
void ZUC_OPERATOR_ERROR::update(CMS* cms)
{
    cms->update(id);
    cms->update(errcode);
    cms->update(error, 256);
}

/*
*	NML/CMS Update function for ZUC_SET_DEBUG
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/
void ZUC_SET_DEBUG::update(CMS* cms) { cms->update(debug); }

void ZUC_SET_CABVOLTAGE::update(CMS* cms) { cms->update(cabVoltage); }

void ZUC_APP_SET_CONNECTSTAT::update(CMS* cms) { cms->update(status); }

/*
*	NML/CMS Update function for ZUC_HALT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/
void ZUC_HALT::update(CMS* cms) { ZUC_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_TASK_PLAN_STEP
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/
void ZUC_TASK_PLAN_STEP::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_TASK_INIT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/
void ZUC_TASK_INIT::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_AUX_CMD_MSG
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/
void ZUC_AUX_CMD_MSG::update(CMS* cms) {}

/*
*	NML/CMS Update function for ZUC_NULL
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/
void ZUC_NULL::update(CMS* cms) {}

// @FIXME liwang 7
void CurFeedForward_update(CMS* cms, double* grvCurrent)
{
    /*for(int i=0;i<6;i++){
		cms->update(grvCurrent[i]);
	}*/
    cms->update(grvCurrent, ZUCMOT_MAX_JOINTS);
}

void ExtIOSetup_update(CMS* cms, ExtIOSetup* x)
{
    cms->update(x->extType);
    cms->update(x->modName, MAX_EXTIO_NAME_LEN);
    cms->update((unsigned char*)(&(x->commInfo)), sizeof(CommInfo));
    cms->update(x->diSetup.startRegAddr);
    cms->update(x->diSetup.pinNum);
    cms->update(x->doSetup.startRegAddr);
    cms->update(x->doSetup.pinNum);
    cms->update(x->aiSetup.startRegAddr);
    cms->update(x->aiSetup.pinNum);
    cms->update(x->aoSetup.startRegAddr);
    cms->update(x->aoSetup.pinNum);
    cms->update(x->ExtIOModInfo, MAX_EXTIO_NAME_LEN);
}

void ExtIOConfig_update(CMS* cms, ExtIOModConfig* x)
{
    ExtIOSetup_update(cms, &(x->extIOSetup));
    cms->update(x->extIOMap.diStartIdx);
    cms->update(x->extIOMap.doStartIdx);
    cms->update(x->extIOMap.aiStartIdx);
    cms->update(x->extIOMap.aoStartIdx);
}

void SensorConfig_update(CMS* cms, SensorConfig* x)
{
    cms->update(x->mode);
    // cms->update((unsigned char*)(&x->commCfg), sizeof(CommInfo));
    // Payload_update(cms, &x->payload);
}

void SensorStatus_update(CMS* cms, SensorStatus* x)
{
    cms->update(x->status);
    cms->update(x->errCode);
    cms->update(x->torque, CART_DIM);
}

void JointMonitorData_update(CMS* cms, JointMonitorData* x)
{
    cms->update(x->instCurrent);
    cms->update(x->instVoltage);
    cms->update(x->instTemperature);
    cms->update(x->insAveragePower);
    cms->update(x->currentFluctuation);
    cms->update(x->sumRunningCircles);
    cms->update(x->sumRunningTime);
    cms->update(x->curRunningCircles);
    cms->update(x->curRunningTime);
    cms->update(x->positionDiff);     // 通道1  ch6-位置误差
    cms->update(x->dualEncoderDiff);  // 通道2  ch15-双编码器差值
    cms->update(x->jointDcVol);       // 通道3  ch90-关节母线电压
    cms->update(x->reserved);         // 通道4  预留
    cms->update(x->jointTorque);
    cms->update(x->jointTorqueCmd);
}

void EndForceCond_update(CMS* cms, EndForceCond* x)
{
    cms->update(x->enableEndCond);
    cms->update(x->lowFlag);
    cms->update(x->upFlag);
    cms->update(x->lowLimitForce);
    cms->update(x->upLimitForce);
}

void IOTrigger_update(CMS* cms, IOTrigger* x)
{
    cms->update(x->ioType);
    cms->update(x->ioIndex);
    cms->update(x->trigEvent);
}

void JointLimit_update(CMS* cms, JointPosLimit* x)
{
    cms->update(x->joint_id);
    cms->update(x->positive_limit);
    cms->update(x->negative_limit);
}

void ZUC_EXTIO_STAT::update(CMS* cms)
{
    cms->update(extIOModCnt);
    for (int i = 0; i < MAX_EXTIO_CNT; ++i) { ExtIOConfig_update(cms, &extIOConfig[i]); }

    cms->update(extIOStat.status);
    cms->update(extIOStat.extDI, MAX_EXTIO_DI_NUM);
    cms->update(extIOStat.extDO, MAX_EXTIO_DO_NUM);
    cms->update(extIOStat.extAI, MAX_EXTIO_AI_NUM);
    cms->update(extIOStat.extAO, MAX_EXTIO_AO_NUM);
}

void ZUC_SENSOR_STAT::update(CMS* cms)
{
    SensorConfig_update(cms, &sensorConfig);
    SensorStatus_update(cms, &sensorStatus);
}

/*
*	NML/CMS Update function for ZUC_MOTION_STAT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/

void ZUC_MONITOR_STAT::update(CMS* cms)
{
    cms->update(scb_hw_version);
    cms->update(scb_sw_version);
    cms->update(scb_ver_str, sizeof(scb_ver_str));
    cms->update(cabTemperature);
    cms->update(robotAveragePower);
    cms->update(robotAverageCurrent);
    cms->update(robotVoltage);
    cms->update(cabinetID);
    cms->update(currRunTime);
    cms->update(accuRunTime);
    cms->update(commState);
    for (int i = 0; i < 6; i++) { JointMonitorData_update(cms, &jointMonitorData[i]); }
}

void ZUC_TASK_PLAN_OPEN::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(file, sizeof(file));
}

/*
*	NML/CMS Update function for ZUC_TASK_PLAN_EXECUTE
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/
void ZUC_TASK_PLAN_EXECUTE::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(command, sizeof(command));
}

void ZUC_SET_SAFE_ZONE::update(CMS* cms)
{
    cms->update(openEnable);
    cms->update(autoEnable);
    cms->update(count);
    cms->update(zone.safe);
    cms->update(zone.elbow_pos_limit_enable);
    cms->update(zone.wrist_pos_limit_enable);
    for (int i = 0; i < 6; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            cms->update(zone.zone.plane[i].planePoints[j].point.x);
            cms->update(zone.zone.plane[i].planePoints[j].point.y);
            cms->update(zone.zone.plane[i].planePoints[j].point.z);
            cms->update(zone.zone.plane[i].planePoints[j].rpy.y);
            cms->update(zone.zone.plane[i].planePoints[j].rpy.p);
            cms->update(zone.zone.plane[i].planePoints[j].rpy.r);
        }
        cms->update(zone.zone.plane[i].safePoint.point.x);
        cms->update(zone.zone.plane[i].safePoint.point.y);
        cms->update(zone.zone.plane[i].safePoint.point.z);
        cms->update(zone.zone.plane[i].safePoint.rpy.y);
        cms->update(zone.zone.plane[i].safePoint.rpy.p);
        cms->update(zone.zone.plane[i].safePoint.rpy.r);
        cms->update(zone.zone.plane[i].safeD);
    }
}

/*
*	NML/CMS Update function for CANON_POSITION
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/
void CANON_POSITION_update(CMS* cms, CANON_POSITION* x)
{
    cms->update(x->x);
    cms->update(x->y);
    cms->update(x->z);
    cms->update(x->a);
    cms->update(x->b);
    cms->update(x->c);
}

void ZUC_TASK_PLAN_PAUSE::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_TASK_PLAN_SET_OPTIONAL_STOP
*	Automanually generated by Alex Joni.
*	on Sat Sep 09 00:18:17 GMT+3 2006
*/
void ZUC_TASK_PLAN_SET_OPTIONAL_STOP::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);

    cms->update(state);
}

/*
*	NML/CMS Update function for ZUC_TASK_PLAN_SET_BLOCK_DELETE
*	Automanually generated by Alex Joni.
*	on Sun Oct 22 17:30:00 GMT+3 2006
*/
void ZUC_TASK_PLAN_SET_BLOCK_DELETE::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);

    cms->update(state);
}

/*
*	NML/CMS Update function for ZUC_TASK_PLAN_OPTIONAL_STOP
*	Automanually generated by Alex Joni.
*	on Sat Sep 24 20:25:27 GMT+3 2006
*/
void ZUC_TASK_PLAN_OPTIONAL_STOP::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

void ZUC_TASK_CALC_TCP::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(methodtype);
    cms->update(id);
    cms->update(saveType);
    cms->update(statusFlag);
    cms->update(jntpoint1, ZUCMOT_MAX_JOINTS);
    cms->update(jntpoint2, ZUCMOT_MAX_JOINTS);
    cms->update(jntpoint3, ZUCMOT_MAX_JOINTS);
    cms->update(jntpoint4, ZUCMOT_MAX_JOINTS);
    cms->update(jntpoint5, ZUCMOT_MAX_JOINTS);
    cms->update(jntpoint6, ZUCMOT_MAX_JOINTS);
}

void ZUC_TASK_CALC_SAFEATT::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    ZucPose_update(cms, &cartpos1);
    ZucPose_update(cms, &cartpos1);
    ZucPose_update(cms, &cartpos1);
    cms->update(tilt);
    cms->update(pan);
    cms->update(tipChoice);
}

void ZUC_TASK_CALC_USER::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(id);
    cms->update(saveType);
    cms->update(statusFlag);
    cms->update(jntpoint1, ZUCMOT_MAX_JOINTS);
    cms->update(jntpoint2, ZUCMOT_MAX_JOINTS);
    cms->update(jntpoint3, ZUCMOT_MAX_JOINTS);
}

void ZUC_TASK_SET_USER_DEFINED_VARIABLE::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(id);
    cms->update(value);
}

void ZUC_TASK_SETUP_TIO_RS485_MODE::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(id);
    cms->update(mode);
}

void ZUC_TASK_SETUP_TIO_RS485_COMM::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(id);
    ModRtuComm_update(cms, &rtuComm);
}

void ZUC_TASK_SETUP_TIO_PIN_MODE::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(type);
    cms->update(mode);
}

void ZUC_TASK_SETUP_TIO_VOUT_ENA::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(enable);
}

void ZUC_TASK_SETUP_TIO_VOUT_VOL::update(CMS* cms)
{
    ZUC_TASK_CMD_MSG::update(cms);
    cms->update(voltage);
}

/*
*	NML/CMS Update function for ZUC_TASK_HALT
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/
void ZUC_TASK_HALT::update(CMS* cms) { ZUC_TASK_CMD_MSG::update(cms); }

/*
*	NML/CMS Update function for ZUC_AUX_INPUT_WAIT
*	Automatically generated by Alex Joni.
*	on Sun Aug 19 1:36:17 GMT+3 2007
*/
void ZUC_AUX_INPUT_WAIT::update(CMS* cms)
{
    ZUC_AUX_CMD_MSG::update(cms);

    cms->update(line_num);
    cms->update(index);
    cms->update(input_type);
    cms->update(wait_type);
    cms->update(timeout);
}

/*
*	NML/CMS Update function for ZUC_TRAJ_RIGID_TAP
*	Manually generated by Alex Joni.
*	on Sun Mar 04 18:15:17 EET 2007
*/

void ZUC_MOTION_SET_DOUT::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(type);
    cms->update(index);
    cms->update(start);
    cms->update(end);
    cms->update(now);
}

void ZUC_MOTION_SETUP_IO_CHANNEL::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(channel_type);
    cms->update(channel_index);
    cms->update(channel_setting);
}

void ZUC_MOTION_SET_BR_STRT_VOLTAGE::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(starting_voltage);
}

void ZUC_SHUT_DOWN::update(CMS* cms) {}

void ZUC_MOTION_ONE_KEY_OP::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    // cms->update(auto_op_setting);
    cms->update(onekeyenable);
    cms->update(autoprogram);
}

void ZUC_MBTIO_ADD_SIGNAL::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(sigName, 128);
    cms->update(chnId);
    cms->update(type);
    cms->update(addr);
}

void ZUC_MBTIO_DEL_SIGNAL::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(sigName, 128);
}

void ZUC_MBTIO_UPDATE_SIGNAL::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(sigName, 128);
    cms->update(freq);
}

void ZUC_MBTIO_SEND_COMMAND::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(chnId);
    cms->update(length);
    cms->update(command, 32);
}
void ZUC_MOTION_SET_CAPTURE::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(captureId);
    cms->update(stateToCapt);
    IOTrigger_update(cms, &trigger);
}

void ZUC_MOTION_CLEAR_CAPTURE::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(captureId);
}

/*
*	NML/CMS Update function for ZUC_MOTION_ADAPTIVE
*	'Automatically' generated by Alex Joni.
*	on Wed May 17 17:34:17 GMT+2+DST 2006
*/
void ZUC_MOTION_ADAPTIVE::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(status);
}

void ZUC_MOTION_EXIT_PROTECT::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(protect_type);
}

void ZUC_MOTION_PERCENTAGE_MODE_LEVEL_VALUE::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(percentage_mode_level1_val);
    cms->update(percentage_mode_level2_val);
}

void ZUC_MOTION_SET_FREE_BUTTON_OPT::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(freeButton);
}

void ZUC_MOTION_SET_FREE_PROG_BUTTON_OPT::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(freeButton);
    cms->update(progButton);
}

void ZUC_MOTION_SET_POINT_BUTTON_OPT::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(pointButton);
}

void ZUC_MOTION_PERCENTAGE_MODE::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(percentage_level);
}

void ZUC_MOTION_REDUCE_MODE::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(reduce_mode);
}

void ZUC_MOTION_KINE_INVERSE::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(robindex);
    ZucPose_update(cms, &tarPose);
    cms->update(currJoint, ZUCMOT_MAX_JOINTS);
}

void ZUC_MOTION_KINE_FORWARD::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    cms->update(robindex);
    cms->update(joints, ZUCMOT_MAX_JOINTS);
}

void ZUC_MOTION_SET_FUNCDI::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    FuncIOMap_update(cms, &funcIOMap);
}

void ZUC_MOTION_SET_FUNCDO::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    FuncIOMap_update(cms, &funcIOMap);
}

void ZUC_MOTION_SET_SAFETY_FUNCDI::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    SafetyFuncDIMap_Update(cms, &sFuncDISettings);
}

void ZUC_MOTION_SET_SAFETY_FUNCDO::update(CMS* cms)
{
    ZUC_MOTION_CMD_MSG::update(cms);
    SafetyFuncDOMap_Update(cms, &sFuncDOSettings);
}

/*
*	NML/CMS Update function for ZUC_MOTION_CMD_MSG
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Oct 11 13:45:17 UTC 2003
*/
void ZUC_MOTION_CMD_MSG::update(CMS* cms) {}

void ZUC_STEP_STATUS::update(CMS* cms)
{
    cms->update(isSteping);
    cms->update(programRunTrigger);
    cms->update(stepEnd);
}

void ZUC_SET_NET_EXCEPTION_HANDLE::update(CMS* cms)
{
    cms->update(timeLimit);
    cms->update(motType);
}

void ZUC_SET_GRPC_ERRCODE::update(CMS* cms)
{
    cms->update(grpc_errtype);
    cms->update(grpc_errcode);
    cms->update(grpc_errmsg, LINELEN);
    cms->update(repeatflag);
    cms->update(saveFlag);
}

void ZUC_SET_SIM_ENABLE::update(CMS* cms) { cms->update(simEnable); }

void ZUC_SYNC_ZUCSETTINGS::update(CMS* cms) {}
void ZUC_SET_MUTI_TOOL_OFFSET::update(CMS* cms)
{
    ZucPose_update(cms, &robotToolOffset);
    cms->update(id);
    cms->update(name, LINELEN);
    cms->update(method);
}
void ZUC_SET_MUTI_USER_OFFSET::update(CMS* cms)
{
    ZucPose_update(cms, &robotUserOffset);
    cms->update(id);
    cms->update(name, LINELEN);
    cms->update(method);
}
void ZUC_TRAJ_SET_PAYLOAD::update(CMS* cms)
{
    cms->update(id);
    Payload_update(cms, &payload);
}